<?php

require_once 'include/util/helperFunctions.php';
require_once 'include/model/Member.php';
require_once 'include/model/Group.php';
require_once 'include/model/Supplement.php';
require_once 'include/model/Event.php';
require_once "include/model/Supplement.php";

/*
 $member = Member::createNew("Thomas", "Dupont", Group::createNew("VGs"), array(Supplement::createNew("VG", 15)));

 echo "Hallo, hieronder volgt een member objectje:<br/>";

    echo $member->getFirstname()." ".$member->getLastname();
    echo $member->getGroup()->getName();
    $suppls = ((array)$member->getSupplements());
    echo $suppls[0];
 */

$event = Event::loadEvent(4);
echo "Main event: ".$event->getName()."<br/>";

echo "Has event?: ".$event->hasSubEvent()."<br/>";

echo "Sub event: ".$event->getSubEvent()."<br/>";
foreach ($event->getSupplements() as $supp) {
	echo $supp."<br/>";
	echo "id:".$supp->getId()."<br/>";
}

echo "<br/>---------------------------------<br /><br />";

$event = Event::loadEvent(4);
echo $event->getName()."<br/>";
echo "subevent: " . $event->getSubEvent()."<br/>";
echo "True:".$event->hasSubEvent()."<br/>";
var_dump($event->hasSubEvent());
foreach ($event->getSupplements() as $supp) {
	echo $supp."<br/>";
	echo "id:".$supp->getId()."<br/>";
}

$dao = EventDAO::getInstance();
var_dump($dao->getSubEventIdByEventId(4));




/*echo "<h2>De eerste 100 leden</h2>";
for ($i = 1; $i <= 100; $i++) {
    $lid = new Member();
    $lid->load($i);

    echo "$lid <br />";
}*/

?>
